<?php

namespace Model;

class Api extends \Lib\Model {
	private $_iErrorCode = 0;
	private $_sErrorMessage = null;
	public function returnResult($sResult) {
		if (is_bool ( $sResult )) {
			if ($sResult) {
				$aResult = array (
						'error' => 0 
				);
			} else {
				$aResult = array (
						'error' => $this->o->aError ['code'],
						'message' => $this->o->aError ['message'] 
				);
			}
		} else {
			$aResult = array (
					'error' => 0 
			) + ( array ) $sResult;
		}
		exit ( json_encode ( $aResult ) );
	}
}